//
//  YBMineTableFooter.swift
//  Moonlight
//
//  Created by Penlon Kim on 2024/1/1.
//  Copyright © 2024 Moonlight Game Streaming Project. All rights reserved.
//

import UIKit
import SnapKit

class YBMineTableFooter: UIView {
    
    var onLogout: (() -> Void)?
    
    override init(frame: CGRect) {
        super.init(frame: frame)
        
        self.addSubview(logoutBtn)
        logoutBtn.snp.makeConstraints { make in
            make.left.right.equalToSuperview().inset(27)
            make.centerX.equalToSuperview()
            make.height.equalTo(45)
            make.top.equalTo(25).priority(.high)
            make.bottom.equalTo(-24)
        }
        
    }
    
    required init?(coder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
    // MARK: - lazy
    private lazy var logoutBtn: UIButton = {
        let btn = self.bk_addButton(type: .custom, title: "退出登录", font: .systemFont(ofSize: 18), bgColor: kRGBColor(180, 172, 140), titleColor: .white, radius: 8)
        btn.bk_addShadowStyleWith(cornerRadius: 8, corners: .allCorners)
        btn.bk_addTarget { [unowned self] sender in
            self.onLogout?()
        }
        return btn
    }()
    
}
